package controller;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.apache.log4j.Logger;

import model.BoardDAO;
import vo.BoardVO;
import vo.MemberVO;

public class ReadAction implements Action {
	Logger logger = Logger.getLogger(ReadAction.class);
	@Override
	public ActionForward execute(HttpServletRequest request,
			HttpServletResponse response) throws ServletException {
		String path = "";
		
		BoardVO bvo = new BoardVO();
		BoardDAO boardDAO = BoardDAO.getInstance();
		
		bvo.setBrdNo(Integer.parseInt(request.getParameter("brdno")));
		
		bvo = boardDAO.getPost(bvo);
		boardDAO.setPostCount(bvo);
		
		logger.debug("response: " + bvo);
		request.setAttribute("bvo", bvo);	
		
		path="/board/get_post.jsp";
		return new ActionForward(path, false);
	}

}
